﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>
<%@ Import Namespace="MyAlbum.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <span class="error"><%=Html.Encode(Model.ErrorMessage)%></span>
        <%
            int itemPerRow = Math.Max(1, Model.Configuration.AlbumsPerRow);
            string width = ((90-itemPerRow*4) / itemPerRow).ToString()+"%";
            foreach(var item in Model.Albums)
            {
                Model.CurrentAlbum = item;
                %>
                <div style=" width:<%=width%>" class="albumBox">
                <%Html.RenderPartial("AlbumItem",Model); %>
              </div>
                <%}%>
    <%if (Model.User.AllowAdd())
    {%>
    <%=Html.ActionLink<AlbumsController>(a=>a.ShowCreate(Model.ParentSection),Model.Localize("Album.Add")) %>
    <%}%>
</asp:Content>
